package com.woniu02;

import java.util.ArrayList;
import java.util.List;

public class Test01 {
    public static void main(String[] args) {
        //list嵌套list
        List<Student> Class1 = new ArrayList<Student>();
        Class1.add(new Student(1,"zs",11));
        Class1.add(new Student(2,"ls",12));

        List<Student> Class2 = new ArrayList<>();
        Class2.add(new Student(1,"ww",13));
        Class2.add(new Student(2,"zl",14));

        List<List<Student>> School = new ArrayList<>();
        School.add(Class1);
        School.add(Class2);

        for(List<Student> myclass:School){
            for(Student student:myclass){
                System.out.println(student);
            }
            System.out.println("------------");
        }
    }
}
